package com.etheart.model.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.search.annotations.AnalyzerDef;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;
import org.hibernate.search.annotations.Similarity;
import org.hibernate.search.annotations.Store;
import org.hibernate.search.annotations.TokenizerDef;
import org.wltea.analyzer.lucene.IKSimilarity;
import org.wltea.analyzer.solr.IKTokenizerFactory;

import com.etheart.model.enums.TranslateState;

/**
 * Translate entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "_translate", catalog = "etheart")
@Indexed
@AnalyzerDef(name = "customanalyzer_translate",
		tokenizer = @TokenizerDef(factory = IKTokenizerFactory.class))
@Similarity(impl=IKSimilarity.class)
public class Translate implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	@DocumentId
	@Field(index = Index.UN_TOKENIZED, store = Store.NO)
	private Long id;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "songid")
	@IndexedEmbedded(prefix="song.",depth=1)
	private Song song;
	@Column(name = "title", length = 100)
	private String title;
	@Column(name = "publish_time", length = 19)
	private Date publishTime;
	@Column
	private String content;
	
	@Column(name = "translate")
	private String translate;
	
	@Column(name = "lyric_url")
	private String lyricUrl;
	@Column(name="_type")
	private String type;
	@Column
	private Integer userid;
	@Column
	private String username;
	@Column
	private Integer good;
	@Column
	private Integer bad;
	@Column(name = "down_count")
	private Integer downCount;
	@Column(name = "from_url")
	private String fromUrl;
	
	
	@Column(name="state")
	@Enumerated(EnumType.STRING)
	private TranslateState state;
	// Constructors

	/** default constructor */
	public Translate() {
	}

	// Property accessors
	
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	
	public Song getSong() {
		return song;
	}

	public void setSong(Song song) {
		this.song = song;
	}



	
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}


	public Date getPublishTime() {
		return this.publishTime;
	}

	public void setPublishTime(Date publishTime) {
		this.publishTime = publishTime;
	}

	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getLyricUrl() {
		return this.lyricUrl;
	}

	public void setLyricUrl(String lyricUrl) {
		this.lyricUrl = lyricUrl;
	}

	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Integer getUserid() {
		return this.userid;
	}

	public void setUserid(Integer userid) {
		this.userid = userid;
	}

	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public Integer getGood() {
		return this.good;
	}

	public void setGood(Integer good) {
		this.good = good;
	}

	public Integer getBad() {
		return this.bad;
	}

	public void setBad(Integer bad) {
		this.bad = bad;
	}

	public Integer getDownCount() {
		return this.downCount;
	}

	public void setDownCount(Integer downCount) {
		this.downCount = downCount;
	}



	public String getFromUrl() {
		return fromUrl;
	}

	public void setFromUrl(String fromUrl) {
		this.fromUrl = fromUrl;
	}

	public String getTranslate() {
		return translate;
	}

	public void setTranslate(String translate) {
		this.translate = translate;
	}

	public TranslateState getState() {
		return state;
	}

	public void setState(TranslateState state) {
		this.state = state;
	}

}